/**
 * @author baz
 */
package lib {
import flash.display.DisplayObject;

public class MathUtils {
    public function MathUtils() {
    }

    /**
     * Get the distance between two sprites
     * @param o1
     * @param o2
     * @return
     */
    public static function distance(o1:DisplayObject, o2:DisplayObject):Number {
        return Math.sqrt(Math.pow(Math.abs(o1.x - o2.x), 2) + Math.pow(Math.abs(o1.y - o2.y), 2));
    }

    /**
     * Calculate angle
     * @param o1
     * @param o2
     * @return
     */
    public static function angle(o1:DisplayObject, o2:DisplayObject):Number {
        return Math.atan2(o1.y - o2.y, o1.x - o2.x);
    }
}
}
